/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pkg2103137032_vii;

/**
 *
 * @author novaldebbyp
 */
import java.util.Scanner;

public class Main {

    /**
     * @param args the command line arguments
     */
    private static int getUserInput(){
        Scanner scan = new Scanner(System.in);
        String userInput = scan.nextLine();
        try {
            return Integer.parseInt(userInput);
        } catch (NumberFormatException e) {
            System.out.println("Silahkan masukkan bilangan bulat.");
            return 0;
        }
    }
    
    public static void main(String[] args) {
        System.out.print("Masukkan saldo : ");
        Tabungan cTabungan = new Tabungan(Main.getUserInput());
        System.out.println("Saldo awal : " + cTabungan.saldo);
        System.out.print("Masukkan jumlah uang yang diambil : ");
        int uangdiambil = Main.getUserInput();
        cTabungan.ambilUang(uangdiambil);
        System.out.println("Jumlah uang yang diambil : " + uangdiambil);
        System.out.println("Jumlah saldo : " + cTabungan.saldo);
    }
}
